From 01a2ea4a336db32a65ff82c491425e697520c430 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Wed, 14 Feb 2007 20:38:02 +0000 Subject: [PATCH] check return value of gtk_widget_translate_coordinates() so we cannot end 2007-02-14 Kristian Rietveld * gtk/gtktooltip.c (child_location_foreach): check return value of gtk_widget_translate_coordinates() so we cannot end up using uninitialized x, y values. (#407863, patch from Carlos Garnacho). svn path=/trunk/; revision=17293 --- ChangeLog | 7 +++++++ gtk/gtktooltip.c | 10 ++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b76671efd5..3cb18e9a1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-14 Kristian Rietveld + + * gtk/gtktooltip.c (child_location_foreach): check return value + of gtk_widget_translate_coordinates() so we cannot end up + using uninitialized x, y values. (#407863, patch from Carlos + Garnacho). + 2007-02-14 Kristian Rietveld * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button): diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 47d08f5204..a001045728 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -390,16 +390,14 @@ static void child_location_foreach (GtkWidget *child, gpointer data) { + gint x, y; struct ChildLocation *child_loc = data; - if (!child_loc->child) - { - gint x, y; - + if (!child_loc->child && gtk_widget_translate_coordinates (child_loc->container, child, child_loc->x, child_loc->y, - &x, &y); - + &x, &y)) + { if (x >= 0 && x < child->allocation.width && y >= 0 && y < child->allocation.height) { -- 2.30.2